<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pForm.jsp" %>
<title>用户编辑页面</title>
<script>
	/*项目部数据切换*/
	function deptChange(newValue, oldValue){
		$("input[name=dept]").val(newValue.join(","));
	}
	
	$(function(){
		fn.onBeforeSubmitForm = function(){
			var dutyText = $('#duty').combobox('getText');
			$("input[name=duty]").val(dutyText);
			return true;
		};
		
		fn.resetForm();
		var dData = fn.getDialogData();
		var deps = dData.dept || '';
		var dutys = dData.duty || ''
		deps = deps.split(',');
		dutys = dutys.split(',');
		setTimeout(function(){
			$('#dept').combogrid('setValues', deps);
			$('#duty').combobox('setValues', dutys);
		},0)
	});
</script>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,border:false" style="padding:10px;">
		<!-- 替换自动form表单 -->
		<form id="easyuiForm" method="post" action="/console/com.fs.base.pojo.User/modify" >
		 <!--类名属性及默认主键id-->
		 <input type="hidden" name="className" value="com.fs.base.pojo.User" />
		 <input type="hidden" name="id" value="" />
		 <input type="hidden" name="dept" value="" />
		  <input type="hidden" name="duty" value="" />
		 
		 <input type="hidden" name="ignoreProperties" value="pwd" />
		 
		 <div style="margin-bottom:20px">
		  	<input class="easyui-textbox" name="account" style="width:240px;"  data-options="label:'用户账号:',required:true" readonly="readonly" />
			<input class="easyui-textbox" type="password" name="pwd" style="width:240px;" data-options="label:'用户密码:',required:true" disabled="disabled" />
		 </div>
		 
		 <div style="margin-bottom:20px">
		  	<input class="easyui-textbox" name="nickName" style="width:240px;" data-options="label:'姓名:',required:true" />
		  	<select class="easyui-combobox" name="gender" style="width:240px;" data-options="label:'性别:'" 
				url="/console/combobox?valueField=dicName&textField=dicName&modleName=dictionary&pCode=A1&pCode_searchType=eq" >
		 	</select>
		 </div>
		 
		 <div style="margin-bottom:20px">
		 	<select class="easyui-combotreegrid" name="orgNo" style="width:240px;" data-options="label:'组织结构:',panelWidth:300,panelWidth:450,    
		           	idField: 'orgNo', 
		           	missingMessage:'必填项',
					treeField: 'orgName',
					sortName:'orgOrder',
					sortOrder:'asc',
		            url:'/console/com.fs.base.pojo.Org/list', 
		            queryParams:{isTreeGrid:'true', treeId:'id', treePid:'parentId' },
		            columns:[[    
		                {field:'orgName',			width:190,	title:'组织名称' }
			         	,{field:'orgType',			width:70,	title:'分类' }
			         	,{field:'orgNo',				width:100,	title:'组织编码' }
			         	,{field:'orgLeaderName',	width:70,	title:'负责人'}
		            ]]">
		        </select>
		 		 <select class="easyui-combogrid" id="dept" style="width:240px;" data-options="label:'项目部:',panelWidth:300,  
		           	idField: 'orgNo', 
		           	missingMessage:'必填项',
					textField: 'orgName',
					sortName:'orgOrder',
					sortOrder:'asc',
					multiple:true,
		            url:'/console/com.fs.base.pojo.Org/list', 
		            onChange:deptChange,
		            queryParams:{orgType:'项目部',orgType_searchType:'eq'},
		            columns:[[    
		                {field:'orgName',			width:190,	title:'组织名称' }
			         	,{field:'orgType',			width:70,	title:'分类' }
		            ]]"></select>
		 </div>

		 <div style="margin-bottom:20px">
		  	<input class="easyui-textbox" name="mobile" style="width:240px;" data-options="label:'手机:',required:false" />
		  <input class="easyui-numberbox" name="age" style="width:240px;" data-options="label:'年龄:',required:false,min:0" />
		 </div>

		 
		  <div style="margin-bottom:20px">
		 	<select class="easyui-combobox" id="duty"  style="width:240px;" data-options="label:'职务:',panelHeight:'100px',multiple:true" 
				url="/console/combobox?valueField=dicName&textField=dicName&modleName=dictionary&pCode=A7&pCode_searchType=eq" >
		 	</select>
		 	 <input class="easyui-textbox" name="email" style="width:240px;" data-options="label:'邮箱:',required:false" />
		 </div>

		 <div style="margin-bottom:20px">
		 	<input class="easyui-textbox easyui-validatebox" name="remark" multiline="true" style="width:500px;height:50px;" data-options="label:'备注:',required:false,validType:'length[0,500]'" />
		 </div>
		</form>
	</div>
</body>
</html>